import java.io.Serializable;

import javax.faces.bean.ApplicationScoped;
import javax.faces.bean.ManagedBean;

@ManagedBean(name="game")
@ApplicationScoped
public class QuickPollSession implements Serializable {
   private static final long serialVersionUID = 1L;
   private String question;
   private String vote;
        
   private int yes = 0;
   private int no = 0;

   public String getVote() {
	   return vote;
   }

   public void setVote(String vote) {
	   this.vote=vote; 
   }

   public String getQuestion() {
	   return question;
   }

   public void setQuestion(String question) {
	   this.question = question;
   }

   public String setup() {
	   if (question.isEmpty()){
		   return "WRONG";
	   }
	   yes = 0; 
	   no = 0; 
	   return "RIGHT";
   }

   public String vote() {
	   if(this.vote.equals("yes")) {
		   yes++;
		   return "RIGHT";
	   }
	   else if (this.vote.equals("no")) {
		   no++;
		   return "RIGHT";
	   }
	   return "WRONG";
   }

   public int getYes() {
	   return yes;
   }

   public void setYes(int yes) {
	   this.yes = yes;
   }

   public int getNo() {
	   return no;
   }

   public void setNo(int no) {
	   this.no = no;
   }
}
